package com.lesama.encapsulation;

public class Student {
    private int age;
    public void setAge(int age) {
        if(age < 0 || age > 180) {
            System.out.println("您输入的年龄非法");
            return;
        }
        this.age = age;
    }
    public int getAge() {
        return age;
    }
}
